import request from '@/utils/request'

export function publishAppToAppStore(app_detail) {
  return request({
    url: `/app/publish_app`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: app_detail
  })
}

export function getPublishedApp(app_id) {
  return request({
    url: `/app/get_published_app_list/${app_id}`,
    method: 'get'
  })
}

export function updateApp(appScript) {
  return request({
    url: `/app/republish`,
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: appScript
  })
}
